package com.nbcio.iot.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * IoT TCP/UDP 服务器配置属性
 */
@Data
@Component
@ConfigurationProperties(prefix = "iot")
public class IotServerProperties {

    private TcpServer tcpServer = new TcpServer();
    private UdpServer udpServer = new UdpServer();

    @Data
    public static class TcpServer {
        private boolean enabled = true;
        private int port = 9999;
        private int bufferSize = 4096; // 预留：TCP读取缓冲区/最大行长度
    }

    @Data
    public static class UdpServer {
        private boolean enabled = true;
        private int port = 9998;
        private int bufferSize = 1024;
    }
}


